Array.prototype.slice = function (start, end) {
  var result = new Array()
  start = start || 0
  end = end || this.length // this指向调用的对象 当用了call后能够改变this的指向
  for (var i = start; i < end; i++) {
    result.push(this[i])
  }
  return result
}
let arr = [1, 2, 4, 5, 6]
console.log(arr.slice(1, 3));
console.log(arr); // slice方法不会改变 原数组
console.log();